package testenv.model.entity;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

import testenv.model.AbstractBaseEntity;


@Entity
@SequenceGenerator(name="elementgroup_id_seq", sequenceName="elementgroup_id_sequence")
public class ElementGroup extends AbstractBaseEntity {
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="elementgroup_id_seq")
	@GenericGenerator(
	     name="elementgroup_id_seq",
	     strategy="sequence",
	     parameters= {
	         @Parameter(name="minvalue", value="1"),
	         @Parameter(name="increment", value="1"),
	         @Parameter(name="sequence", value="elementgroup_id_sequence")
	         })
	private Integer id = null;
	
	
	@ManyToOne
	@JoinColumn(name="structure_id", insertable=false, updatable=false, nullable=false)
	private Structure structure = null;
	
	@Column(name="position", insertable=false, updatable=false)
	private Integer position = null;
	
	@Column(nullable=false, length=50)
	private String elementGroupName = null;
	
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getElementGroupName() {
		return elementGroupName;
	}

	public void setElementGroupName(String elementGroupName) {
		this.elementGroupName = elementGroupName;
	}

	public Structure getStructure() {
		return structure;
	}

	public void setStructure(Structure structure) {
		this.structure = structure;
	}
	
	public Integer getPosition() {
		return position;
	}
	public void setPosition(Integer position) {
		this.position = position;
	}


}
